<template>
    <div>
      <div class="breadcrumb-main">
        <div class="breadcrumb-inner">
          <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/web/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>集团新闻详情</el-breadcrumb-item>
          </el-breadcrumb>
        </div>
      </div>
      <div class="web-inner-main" style="padding-bottom: 50px;">
        <h3 class="news-details-title">{{details.title}}</h3>
        <div class="subTit">
          <span class="time">作者：管理员</span>
          <span class="time">发布时间：{{details.createTime | formatDate}}</span>
          <span class="look1">阅读 ：<em>21</em></span>
        </div>
        <div class="news-details-inner" v-html="details.content"></div>
      </div>
    </div>
  </template>
  <script>
  import {getNewsDetails} from "@/api/web_api"
  import moment from 'moment'
  export default {
    name:"webNewsDetails",
    data() {
      return {
        details:{}
      };
    },
    filters: {
        formatDate (value) {
            if (!value) {
            return ''
            }
            return moment(value).format("YYYY-MM-DD")
        }
    },
    mounted() {
        const id = this.$route.query.id;
        if(id){
            this.getDetails(id);
        }
    },
    methods: {
        async getDetails(id) {
            let params = {};
            const {code,data} = await getNewsDetails(id);
            if(code === 200){
            this.details = data;
            }
        }
    }
  };
  </script>
